import Vue from 'vue'
import VueRouter from 'vue-router'
import LayoutIndex from '@/views/layout'
import LoginIndex from '@/views/login'
import DashBoard from '@/views/dashboard'
import ArticleIndex from '@/views/article'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: LayoutIndex,
    redirect: 'dashBoard',
    children: [
      { path: 'dashBoard', component: DashBoard },
      { path: 'article', component: ArticleIndex }
    ]
  },
  { path: '/login', component: LoginIndex }
]

const router = new VueRouter({
  // base: process.env.BASE_URL,
  mode: 'history',
  routes,
  linkActiveClass: 'active',
  linkExactActiveClass: 'ex-active'
})

export default router
